package modelLayer;

import java.util.ArrayList;

public class Sale
{
    private static int index;
    private int id;
    private double totalPrice;
    private String date;
    private ArrayList<SaleLine> saleLines;
    private Staff staff;
    
    public void setId(int id){this.id = id;}
    public void setTotalPrice(double totalPrice){this.totalPrice= totalPrice;}
    public void setDate(String date){this.date = date;}
    public int getId(){return id;}
    public double getTotalPrice(){return totalPrice;}
    public String getDate(){return date;}
    public ArrayList<SaleLine> getSaleLines(){ return saleLines;}
    public Staff getStaff(){return staff;}
    
    public Sale(double totalPrice, String date, Staff staff){
        id = ++index;
        this.totalPrice = totalPrice;
        this.date = date;
        this.staff= staff;
        saleLines = new ArrayList<>();
    }
    
    public void addSaleLine(SaleLine saleLine){
    
        saleLines.add(saleLine);
    
    }
  
   
}
